home *** CD-ROM | disk | FTP | other *** search
/ LOGIC Apps / Logic-APPLE_II_APPS.iso / pc / LOGIC Apple II 5.25" Library - DOS Part 7 / DOS203A.dsk / DMFE.APPLESOFT.txt < prev    next >
Text File  |  2012-02-16  |  7KB  |  24 lines

  1.  
  2.  
  3.      The structure of the applesoft program is as follows: the most used subroutines are at the beginning, with the main code in the middle and the program initialization at the end.  The main loop which is infinite, compares a key press to a string for a valid match and executes the appropriate subroutine.  This continues until the option to quit is taken.
  4.  
  5.      Line 80 jumps to the program initialization code.  Lines 120 to 140 xdraw the cursor (draw),get a command and redraw the cursor (erase).  Lines 150 to 180 search the string CD$ for a valid match to the key press.  Line 190 checks to see if it is a DOS command or PRINT command and saves the current character to memory if it is.  Lines 200 to 210 execute the appropriate subroutine.
  6.  
  7.      Lines 250 to 330 plot or unplot (depending on color) the dot at CX and CY.  It also updates the array CH$(*).  Lines 370 to 400 initialize the current character to all zero's.  Lines 440 to 450 set up the text window for DOS commands.  Lines 490 to 500 Set up the text window for editing commands.  Line 540 is a string print routine from NIBBLE vol. 7 no. 8 by Paul S. Dunseath.
  8.  
  9.      Lines 600 to 620 adjust CY to move the cursor up.  Lines 660 to 670 do a gosub to move left one half step.  If it is not at an edge then it moves one half step left again. Lines 710 to 720 adjust CX to move the cursor left one half step.  Lines 760 to 770 do a gosub to move right one half step.  If it is not at an edge then it moves one half step right again.  Lines 810 to 820 adjust CX to move the cursor right one half step.  Lines 860 to 880 adjust CY to move the cursor down.
  10.    
  11.      Line 920 sets the dot indicator "on"(1), the hcolor to white and gosubs the update routine.  Line 960 sets the dot indicator "off"(0), the hcolor to black and gosubs the update routine.  Lines 1000 to 1020 gosub the character initialization routine, set the hcolor to black and call the M.L. routine to erase the hi-res screen.  Lines 1060 to 1140 set the hcolor to black, call the M.L. routine to clear the hi-res screen and gosub the character initialization routine.  Next the editing box is filled with dots and the character array is initialized to "1"'s.
  12.  
  13.      Lines 1180 to 1240 save the current character, increment the character pointer and gosub to the middle of the character get routine.  Lines 1250 to 1280 save the current character, decrement the character pointer and gosub to the middle of the character get routine.  Lines 1320 to 1440 save the current character and get a character to edit.  A loop is set up to get each character from the keyboard one at a time for a maximum of four characters.  If the input is preceeded by a # sign then its value is used as opposed to the ASCII value of a single character.  Lines 1450 to 1460 check to see if the character is in the valid range for the current character set in use.  The character is then recalled from memory.  Line 1470 assigns the character width offset.  Lines 1480 to 1500 print out the ASCII value of the character and poke the character directly to the screen.  Line 1510 prints the download flag.  Lines 1520 to 1540 blank out the previous proportional flag, print the new proportional flag and character width offset if there is one.  Line 1550 prints out the descender flag.  Lines 1560 to 1610 do a loop through the array CH$(*) and draw a dot if the substring has a value of one.  Lines 1620 to 1640 increment the garbage counter and collect the garbage when the count resets itself to zero.
  14.  
  15.      Lines 1680 to 1700 toggle the descender flag and lines 1740 to 1760 toggle the download flag.  Lines 1800 to 1850 toggle the proportional flag.  If it is being toggled on then the user is asked to select the character width offset (CWO).  The CWO defaults to "1" but remains at the last setting irregardless of the proportional flag being toggled on or off.  It has no effect if the proportional flag is turned off.  Lines 1890 to 1950 erase the entire character set after confirmation and then jump to begin or edit code.
  16.  
  17.      Lines 1990 to 2210 print the character currently being edited.  Line 2010 turns on the printer where C is the slot number.  Line 2030 sends the download defintion to the printer (set in line 3320).  Lines 2050 to 2090 calculate the character bytes.  Lines 2100 to 2110 poke the byte directly to the printer interface.  Lines 2130 to 2210 print the character where C is the slot number.
  18.  
  19.      Lines 2250 to 3210 are the DOS routines.  Lines 2250 to 2310 print the DOS menu.  Lines 2320 to 2370 get a key, compare it to CD$ for a valid match and gosub the appropriate routine.  Lines 2430 to 2450 catalog the data disk slot.  Lines 2490 to 2540 delete a file after confirmation.  Lines 2580 to 2660 load a character set into memory after confirmation.  Lines 2700 to 2780 print a save file menu, get a key and gosub the appropriate routine.  Lines 2820 to 2900 save the current character set after confirmation.  Lines 2940 to 3120 save a font file.  The option to have the download routine initialize the printer ram is specified at this point.  Next the download routine is called to convert the character set into a font file.  The length of the file is determined and added to the length of the download to printer routine.  The font is then saved.
  20.  
  21.      Lines 3160 to 3250 get confirmation for impending action.  Return alone to continue or any other key will abort the action.  Line 3290 checks the location of the program and if it is below hi-res page 1 then it resets the start of program pointers and reruns the program.  Lines 3310 to 3350 initialize strings and variables (FIG 4).  Line 3360 sets the file name width to 26 and the number of files diplayed during a catalog to 15 (see PRODOS modifications).  Lines 3370 to 3490 print out the title page using the slow print routine after setting the text window so no scrolling occurs.  Lines 3500 to 3530 load in the shape table and the support routines CONVERT, DOWNLOAD.  Lines 3550 to 3650 get the data disk slot and drive.  Line 3670 calls the character set initialization routine.  Lines 3680 to 3740 get the mode and type of character set to use.  Lines 3750 to 3760 assign values to variables.  Line 3770 builds the command string by concatenating the CHR$(values) of the command keys in the order of execution.  Lines 3780 to 3800 set the text window and print the flag headings.  Lines 3810 to 3850 set the hi-res page to 1 and clear the screen to black.  After the editing block and border are drawn on the screen, a gosub to the character get routine is taken.  When it returns the program jumps to the command input routine.  
  22.  
  23.      Lines 3890 to 4050 handle the onerr routine.  All errors are recoverable except for an "out of memory error".  Lines 4090 to 4140 exit the editor to basic after resetting DOS, the text window and clearing up the screen.
  24.